﻿namespace Pyramid
{
    /// <summary>
    /// Common interface for Ternary numeric types.
    /// </summary>
    public interface ITernary
    {
        /// <summary>
        /// Gets the size of the number, measured in trits.
        /// </summary>
        int TritSize { get; }

        /// <summary>
        /// Gets the value of the number, represented as an array of trits.
        /// </summary>
        /// <returns>
        /// An array of trits that contains the value of the number, in
        /// Little-Endian order.
        /// </returns>
        Trivalent[] ToTritArray();

        /// <summary>
        /// Gets the value of the number as a 9-trit Tryte.
        /// </summary>
        /// <returns></returns>
        Tryte ToTryte();

        /// <summary>
        /// Gets the value of the number as a 27-trit integer.
        /// </summary>
        /// <returns></returns>
        Int27 ToInt27();
    }
}
